package com.faithbj.support.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
 * 电子比对请求类
 * @author chen liu
 *
 */
public class CompareRequest implements Serializable{
	private static final long serialVersionUID = 1L;

	private String batchNum;               // 批次号
	private String departmentNum;          // 部门编号
	private String mainApplicantName;       // 主申请人姓名
	private String mainApplicantCardId;    // 主申请人身份证号
	private List<Applicant> applicants = new ArrayList<CompareRequest.Applicant>();     // 申请人列表
	private Date startDate;                // 起始日期
	private Date endDate;                  // 截止日期
	
	private String applyNum;               // 申请编号=受理编号
	
	public CompareRequest(){}
	
	public CompareRequest(String batchNum, String departmentNum,
			String mainApplicantName, String mainApplicantCardId,
			Date startDate, Date endDate, String applyNum) {
		this.batchNum = batchNum;
		this.departmentNum = departmentNum;
		this.mainApplicantName = mainApplicantName;
		this.mainApplicantCardId = mainApplicantCardId;
		this.startDate = startDate;
		this.endDate = endDate;
		this.applyNum = applyNum;
	}
	
	public String getBatchNum() {
		return batchNum;
	}
	public void setBatchNum(String batchNum) {
		this.batchNum = batchNum;
	}
	public String getDepartmentNum() {
		return departmentNum;
	}
	public void setDepartmentNum(String departmentNum) {
		this.departmentNum = departmentNum;
	}
	public String getMainApplicantName() {
		return mainApplicantName;
	}
	public void setMainApplicantName(String mainApplicantName) {
		this.mainApplicantName = mainApplicantName;
	}
	public String getMainApplicantCardId() {
		return mainApplicantCardId;
	}
	public void setMainApplicantCardId(String mainApplicantCardId) {
		this.mainApplicantCardId = mainApplicantCardId;
	}

	public List<Applicant> getApplicants() {
		return applicants;
	}

	public void addApplicant(String applicantName, String applicantCardId) {
		applicants.add(new Applicant(applicantName, applicantCardId));
	}

	public Date getStartDate() {
		return startDate;
	}
	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}
	public Date getEndDate() {
		return endDate;
	}
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public String getApplyNum() {
		return applyNum;
	}

	public void setApplyNum(String applyNum) {
		this.applyNum = applyNum;
	}

	public class Applicant {
		private String applicantName;          // 申请人姓名
		private String applicantCardId;        // 申请人身份证号
		
		public Applicant(String applicantName, String applicantCardId) {
			this.applicantName = applicantName;
			this.applicantCardId = applicantCardId;
		}
		public String getApplicantName() {
			return applicantName;
		}
		public void setApplicantName(String applicantName) {
			this.applicantName = applicantName;
		}
		public String getApplicantCardId() {
			return applicantCardId;
		}
		public void setApplicantCardId(String applicantCardId) {
			this.applicantCardId = applicantCardId;
		}
	}
	
	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("batchNum = "  + batchNum)
		.append("departmentNum = " + departmentNum)
		.append("mainApplicantName = " + mainApplicantName)
		.append("mainApplicantCardId = " + mainApplicantCardId)
		.append("startDate = " + startDate)
		.append("endDate = " + endDate)
		.append("applyNum = " + applyNum);
		sb.append("applicants = [");
		for(Applicant applicant : getApplicants()){
			sb.append(applicant.getApplicantName() + "-" + applicant.getApplicantCardId() + ";");
		}
		sb.append("]");
		return sb.toString();
	}
	
}
